//
//  XZTestHeadView.m
//  Teecloud
//
//  Created by PC on 2018/12/25.
//  Copyright © 2018年 小志. All rights reserved.
//

#import "XZTestHeadView.h"
#import "XZSummaryInfo.h"

@interface XZTestHeadView ()

//应到人数
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
//缺考人数
@property (weak, nonatomic) IBOutlet UILabel *loseCountLabel;
//未交卷人数
@property (weak, nonatomic) IBOutlet UILabel *testingOutCountLabel;
//通过人数
@property (weak, nonatomic) IBOutlet UILabel *passCountLabel;
//合格率
@property (weak, nonatomic) IBOutlet UILabel *passRateLabel;
//平均分
@property (weak, nonatomic) IBOutlet UILabel *avgScoreLabel;

@end
#define PerformColor [UIColor colorWithHexString:@"128B03" andAlpha:1.0f]
@implementation XZTestHeadView
- (void)setModel:(XZSummaryInfo *)model{
    _model = model;
    self.countLabel.text = [NSString stringWithFormat:@"%@人",model.Count];
    //缺考
    self.loseCountLabel.text = [NSString stringWithFormat:@"%@人",model.LoseCount];
    if ([model.LoseCount integerValue] == 0) {
        self.loseCountLabel.textColor = kBlackColor;
    }else{
        self.loseCountLabel.textColor = kRedColor;
    }
    
    self.testingOutCountLabel.text = [NSString stringWithFormat:@"%@人",model.TestingCount];
    //合格
    self.passCountLabel.text = [NSString stringWithFormat:@"%@人",model.PassCount];
    if ([model.PassCount integerValue] == 0) {
        self.passCountLabel.textColor = kBlackColor;
    }else{
        self.passCountLabel.textColor = PerformColor;
    }
    
    self.passRateLabel.text = [NSString stringWithFormat:@"%@%@",model.PassRate,@"%"];
    self.avgScoreLabel.text = [NSString stringWithFormat:@"%@",model.AvgScore];
    
}
@end
